 //
//  AboutUsViewController.m
//  LocomotiveGuards
//
//  Created by zwj on 15-11-30.
//  Copyright (c) 2015年 REDOOR. All rights reserved.
//

#import "AboutUsViewController.h"

@interface AboutUsViewController ()

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self createMyNav];
    [self configView];
}

- (void)createMyNav
{
    [self addTitle:@"关于我们" imageName:@"aboutus"];
    [self addBackBtnTarget:self action:@selector(backBtnClick)];
}

- (void)configView
{
    UIImageView *iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-152*W)/2, 20+64*H, 152*W, 66*H)];
    [iconImageView setImage:[UIImage imageNamed:@"aboutus_icon"]];
    [self.view addSubview:iconImageView];
    
    UILabel *companyLabel = [self createLabelFrame:CGRectMake(40*W, CGRectGetMaxY(iconImageView.frame)+20*H, SCREEN_WIDTH-80*W, 40*H) title:@"西藏舟航物联科技有限公司" font:[UIFont boldSystemFontOfSize:18]];
    companyLabel.textColor = [UIColor grayColor];
    [self.view addSubview:companyLabel];
    
    UIScrollView *bgView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 20+44*H+150*H, SCREEN_WIDTH, SCREEN_HEIGHT-(20+44*H+150*H)-TABBAR_HEIGHT)];
    bgView.backgroundColor = [UIColor colorWithRed:247.f/255.f green:248.f/255.f blue:248.f/255.f alpha:1.0f];
    
    UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(30*W, 20*H, SCREEN_WIDTH-60*W, 0)];
    descriptionLabel.text = @"舟航物联，作为国内领先的车辆安全与管理解决方案提供商，为车主提供更智能、更便捷、更贴心的车辆安全保障服务；为公安机关提供更立体、更科学、更有效的车辆公共安全与管理系统级解决方案。以服务立体化社会治安防控体系和平安城市建设为目标，依托车联网和大数据挖掘技术，深入挖掘车联网关联数据与社会治安巡防的内在联系。创新推出“车辆公共安全与综合管理解决方案”，实现了车辆状态智能感知的产品创新，车辆安全与管理的平台创新以及车联网大数据模块设计与运算处理的应用创新。";
    descriptionLabel.textColor = [UIColor grayColor];
    descriptionLabel.font = [UIFont systemFontOfSize:13];
    descriptionLabel.numberOfLines = 0;
    
    NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:descriptionLabel.text];
    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:10];//调整行间距
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [descriptionLabel.text length])];
    descriptionLabel.attributedText = attributedString;
    [descriptionLabel sizeToFit];
    bgView.contentSize = CGSizeMake(SCREEN_WIDTH, descriptionLabel.frame.size.height + 30 * H);
    [bgView addSubview:descriptionLabel];
    [self.view addSubview:bgView];
    
    
    
//    self.view.frame = CGRectMake(bgView.bounds.origin.x, bgView.bounds.origin.y, SCREEN_WIDTH, bgView.bounds.size.height) ;
//    self.view.backgroundColor = [UIColor greenColor];
    
    
    
    
    
}

#pragma mark - 点击事件
- (void)backBtnClick
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark -
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
